package com.thiny.android.app.tnote.ui;

import android.app.Activity;
import android.widget.Toast;

import com.thiny.android.app.tnote.util.Env;

public class BaseActivity extends Activity {

	private Toast mToast;
	
	protected void showToast(int resId) {
		if (mToast == null) {
			mToast = Toast.makeText(this, getString(resId), Toast.LENGTH_SHORT);
		}else {
			mToast.setText(resId);
			if (Env.getSDKVersion() < 14) {
				mToast.cancel();
			}
		}
		mToast.show();		
	}
	
	protected void showToast(String text) {
		if (mToast == null) {
			mToast = Toast.makeText(this, text, Toast.LENGTH_SHORT);
		}else {
			mToast.setText(text);
			if (Env.getSDKVersion() < 14) {
				mToast.cancel();
			}
		}
		mToast.show();		
	}
	
	
}
